Recaptcha php problem [closed]
Posted
by
Sam Gabriel
on Programmers
See other posts from Programmers
or by Sam Gabriel
Published on 2011-01-06T21:09:43Z
Indexed on
2011/01/06
21:59 UTC
Read the original article
Hit count: 428
php
Hey guys, I'm using recaptcha and I've got a problem, when a user clicks the signup button it redirects him to the sign up verification page, and here is the code, found on the very top of the web code, that checks the recaptcha entered data.
<?php
require_once('recaptchalib.php');
$privatekey = "***";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
header('location: signup.php');
}
?>
But it seems whatever I type in in the recaptcha box, be it right or wrong, I get redirected to the signup.php page.
Here is the recaptcha code in the signup.php page:
<?php
ini_set('display_errors', 'On');
error_reporting(E_ALL | E_STRICT);
require_once('recaptchalib.php');
$publickey = "***";
echo recaptcha_get_html($publickey);
?>
© Programmers or respective owner